Several high quality rendering algorithms attempt to present a form of realism typically lacking in most computer generated graphics displays. Visual queues that portray depth of field, lighting and optical effects, shadows, material properties, and physical phenomenon, aid tremendously in the overall perception of an image. In rendering computer graphics, geometric shapes can appear jagged, in part, due to the approximation involved in attempting to draw a geometric on a discrete grid of points. A more pleasing geometric shape can be drawn by applying what have come to be known as antialiasing techniques. When pixels located at the edge of a geometric shape are densely covered in a color, the edge appears jagged as shown in FIG. 1A. However, if the pixels located at the edge of the geometric shape are less solidly covered in color, then the edge will appear softer as shown in FIG. 1B.
Traditionally, there are two common methods of antialiasing: supersampling and area sampling. Supersampling is a "brute force" solution. Therefore it is straightforward, but requires vast amounts of data storage. Area sampling based algorithms are more economical, but produce images which are of lower quality than those generated by supersampling.
In supersampling, rather than using a single sample of the data for each pixel, several samples with higher bandwidth are utilized, effectively increasing the resolution of the image. Many point samples are typically taken in the region of each pixel, and these samples are integrated, perhaps with a weighting function, to obtain the final pixel shading. Before the image is output for viewing, a 2D filter is typically applied which properly scales the output image resolution. For example, assume nine samples are used for each output pixel. Nine times as many depth and color samples must be stored in the z buffer and image buffer. Furthermore, nine times as many depth comparisons and blend operations must also be computed. The problem associated with supersampling is the huge amount of memory required and high object data/pixel data bandwidth. Consequently, supersampling can be highly expensive.
To eliminate the memory requirement of conventional supersampling, an accumulation buffer can be used. When accumulation buffers are used, samples are typically scaled before being stored in an image buffer. They are summed during the storing operation. Using the same example used in supersampling, assume nine samples are used for each output pixel. Nine times as many depth and color samples must be taken. Furthermore, nine times as many depth comparisons and blend operations must also be computed. Each incoming data would be multiplied by 1/9 prior to storage and summed with the previously stored data. In effect, this method performs supersampling prior to storage. Supersampling used with an accumulation buffer is typically associated with having a high object data bandwidth and requiring low storage in the image buffer. The problem with this method, however, is that it is expensive to process such a large multiple of the data. Another problem with this method is that the Z buffer also requires nine times the storage to maintain geometric accuracy.
Area sampling describes a class of algorithms which use a sub-pixel resolution mask to control the compositing of the object data. These algorithms are often referred to as A-buffer based. Area sampling algorithms vary in the complexity of hidden surface removal and color blending techniques. More complex hidden surface removal requires more data storage, but results in a higher image quality. More complex color blending requires additional arithmetic functions which can be costly and/or slow.
There are a variety of area sampling processes. One such process assigns an alpha (.alpha.) value associated with each pixel. The a value is an indication of the transparency of the pixel. For example, if the pixel is half transparent, then the .alpha. value would equal 0.5 (or 128 in fixed point 8-bit binary). Each pixel is also assigned a mask value associated with it. The mask value indicates the amount of coverage within the pixel. For instance, if a pixel is only half covered with color, then the mask associated with the pixel will indicate such. Rather than storing the nine values as in supersampling, this method would store an .alpha.'RGB where .alpha.'=.alpha.*coverage value.
The problem associated with area sampling is that it is typically not accurate. This method works well for one pixel layer, but not with multiple pixel layers. When data is in an image buffer, the mask of the pixel is no longer known, thus causing a loss of geometric precision. In FIG. 2A, the output of the two colors red and green abutting one another should be red plus green blended, while the color red in front of the color green should have an output of the color red, as shown in FIG. 2B. The conventional area sampling methods typically cannot tell the difference between the situation shown in FIG. 2A where the two colors are abutting and the situation shown in FIG. 2B where the two colors are overlapping because the mask and coverage information is typically discarded prior to being stored in the compositing stage.
What is needed an improved method and system of antialiasing which avoids the expensive memory use and bandwidth of supersampling and yet retains geometric precision of the image to be represented. The present invention fills such a need.
The following references provide further background information: Kurt Akeley, "Reality Engine Graphics", Proceeding of SIGGRAPH '93 (August 1993), p. 109-116; Carpenter, Loren, "The A-buffer, an Antialiased Hidden Surface Method", ACM Computer Graphics, Vol. 18, No. 3, July 1984, p. 103-108; Haeberli, Paul and Kurt Akeley, "The Accumulation Buffer: Hardware Support for High-Quality Rendering", ACM Computer Graphics, Vol. 24, No. 4, August 1990, p. 309-318; Mammen, Abraham, "Transparency and Antialiasing Algorithms Implemented with the Virtual Pixel Maps Technique", IEEE Computer Graphics & Application, July 1989, p. 43-55.